'use strict'
const { query } = require('../app/helper/db');

module.exports.up = function (next) {
  query(`
    CREATE TABLE \`order\` (
      id int(11) unsigned NOT NULL AUTO_INCREMENT,
      amount int(11) unsigned NOT NULL comment '',
      payat int(11) unsigned NOT NULL comment '',
      status int(11) unsigned NOT NULL comment '',
      freight int(11) unsigned NOT NULL comment '',
      createdat int(11) NOT NULL comment '',
      PRIMARY KEY (id)
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
  `).then(() => {
    next();
  }).catch(err => {
    throw err;
  })
}

module.exports.down = function (next) {
  next()
}
